package com.base.model.service1.db

import com.baomidou.mybatisplus.annotation.IdType
import com.baomidou.mybatisplus.annotation.TableId
import com.baomidou.mybatisplus.annotation.TableName
import com.yfree.model.YModel
import org.springframework.data.mongodb.core.mapping.Document
import org.springframework.data.mongodb.core.mapping.Field
import javax.persistence.Entity
import javax.persistence.Id

@Entity
@Document("t_test")
class Model_Service1_MongoDB : YModel {
    @Id
    @Field("id")
    var id = 0

    constructor()
    constructor(id: Int) {
        this.id = id
    }
}

class Model_Service1_MyBatisDB : YModel() {
    var id: String? = null
}

@TableName("t_test")
class Model_Service1_MyBatisPlusDB : YModel() {
    //主键字段
    @TableId(type = IdType.ASSIGN_UUID)
    var id: String? = null

//    //自定义列名
//    @TableField("name")
//    var name: String? = null
//
//    //非表字段
//    @TableField(exist = false)
//    var abcdefg: String? = null
//
//    //逻辑删除，除自定义sql之外的增删改查都会自动加上isDelete条件判断
//    @TableField(select = false)
//    @TableLogic(value = "0", delval = "1")
//    var isDelete: String? = null
}

class Model_Service1_Redis : YModel {
    var id: String? = null

    constructor(id: String) {
        this.id = id
    }
}
